package com.rran.study.designpattern.behavioral.chain;


import com.rran.study.designpattern.behavioral.chain.chain.*;

/**
 * 简单的责任链模式
 */
public class ChainSimpleApplication {

    public static void main(String[] args) {
        System.out.println("简单的责任链模式");
        AttackPlaceAChain chainA = new AttackPlaceAChain();
        AttackPlaceBChain chainB = new AttackPlaceBChain();
        AttackPlaceCChain chainC = new AttackPlaceCChain();
        AttackPlaceDChain chainD = new AttackPlaceDChain();
        AttackPlaceEChain chainE = new AttackPlaceEChain();
        chainA.setNextChain(chainB);
        chainB.setNextChain(chainC);
        chainC.setNextChain(chainD);
        chainD.setNextChain(chainE);
        chainA.attack();
    }
}
